<template>
	<view>
		<uni-nav-bar left-icon="arrowthinleft" title="商家信息" :border="false" :fixed="true" bg="bg-fff" color="#333"
			@clickLeft="goBack()"></uni-nav-bar>
		<view class="margin-top-20 bg-fff padding-x-24">
			<view class="fs-28 color-333 padding-y-24">商家</view>
			<view class="flex align-center flex-wrap">
				<image v-for="(item,index) in info.imgs" :key='index' :src="item"
					style="margin-bottom: 20rpx; width: 150rpx;height: 190rpx;border-radius: 10rpx;margin-right: 20rpx;">
				</image>
			</view>
		</view>
		<view class="margin-top-20 padding-24 bg-fff">
			<view class="fs-28 color-333">店铺基本情况</view>
			<view class="fs-24 color-666 margin-top-24">{{info.introduce}}</view>
		</view>
		<view class="margin-top-20 padding-24 bg-fff">
			<view class="fs-28 color-333">店铺特色</view>
			<view class="fs-24 color-666 margin-top-24"><text class="margin-right-20" v-for="(item,index) in info.other"	:key='index'>{{item}}</text></view>
		</view>
		<view @click="openMap()" class="margin-top-20 padding-24 bg-fff flex align-center justify-between">
			<view class="fs-28 color-666">商家位置</view>
			<text class="fs-28 color-333">{{info.jw_address}}</text>
			<image src="../../static/img/ads.png" style="width: 34rpx;height: 34rpx;"></image>
		</view>
		<view class="margin-top-20 padding-24 bg-fff flex align-center">
			<view class="fs-28 color-666">商家客服电话</view>
			<text class="margin-left-60 color-zhuse fs-28">{{info.mobile}}</text>
			<!-- <text @click="onCall()" class="fs-24 color-fff bg-zhuse margin-left-60" style="padding: 6rpx 16rpx;">查看</text> -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				shop_id: '',
				info: {}
			}
		},
		onLoad(opt) {
			this.shop_id = opt.shop_id;
			this.getInfo()
		},
		methods: {
			getInfo() {
				this.$api.shop_info({
					shop_id: this.shop_id
				}).then(res => {
					if (res.code == 1) {
						this.info = res.data
					}
				})
			},
			// 查看位置
			openMap() {
				uni.openLocation({
					latitude: Number(this.info.latitude),
					longitude: Number(this.info.longitude),
					success: function() {
						console.log('success');
					}
				});
			},
			
			// 拨打电话
			onCall(){
				uni.makePhoneCall({
				    phoneNumber: this.info.mobile
				});
			}
			
		}
	}
</script>

<style>
	page {
		background: #F7F7F7;
	}
</style>
